namespace QMVnSoft.SystemForms
{
    using QMVnSoft.Controls;
    using System;
    using System.ComponentModel;
    using System.Data;
    using System.Drawing;
    using System.Windows.Forms;

    public class FormCheckDeleted : FormControl
    {
        private DataGridViewTextBoxColumn Column1;
        private IContainer components;
        private GridControl grdBrowser;
        private LabelControl lblWarning;
        private DataTable oLocalTable;

        public FormCheckDeleted()
        {
            this.InitializeComponent();
            this.grdBrowser.AutoGenerateColumns = false;
        }

        protected override void Dispose(bool disposing)
        {
            if (disposing && (this.components != null))
            {
                this.components.Dispose();
            }
            base.Dispose(disposing);
        }

        private void InitializeComponent()
        {
            this.grdBrowser = new GridControl();
            this.lblWarning = new LabelControl();
            this.Column1 = new DataGridViewTextBoxColumn();
            ((ISupportInitialize) this.grdBrowser).BeginInit();
            base.SuspendLayout();
            this.grdBrowser.AllowUserToAddRows = false;
            this.grdBrowser.AllowUserToDeleteRows = false;
            this.grdBrowser.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.Fill;
            this.grdBrowser.CheckColor = false;
            this.grdBrowser.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.AutoSize;
            this.grdBrowser.Columns.AddRange(new DataGridViewColumn[] { this.Column1 });
            this.grdBrowser.Dock = DockStyle.Top;
            this.grdBrowser.Font = new Font("Arial", 8.25f);
            this.grdBrowser.Location = new Point(0, 0);
            this.grdBrowser.Name = "grdBrowser";
            this.grdBrowser.ReadOnly = true;
            this.grdBrowser.Size = new Size(0x1aa, 0xee);
            this.grdBrowser.TabIndex = 0;
            this.lblWarning.Font = new Font("Arial", 8.25f);
            this.lblWarning.ForeColor = Color.Red;
            this.lblWarning.Location = new Point(12, 0xf1);
            this.lblWarning.Name = "lblWarning";
            this.lblWarning.Size = new Size(0x192, 0x20);
            this.lblWarning.TabIndex = 1;
            this.lblWarning.Text = "Đã có phát sinh đối với mã này. Không thể xóa được. Sử dụng chức năng gộp mã (F6) trước khi xóa.";
            this.Column1.HeaderText = "Tên tệp";
            this.Column1.Name = "Column1";
            this.Column1.ReadOnly = true;
            base.AutoScaleDimensions = new SizeF(6f, 13f);
            base.ClientSize = new Size(0x1aa, 0x11a);
            base.Controls.Add(this.lblWarning);
            base.Controls.Add(this.grdBrowser);
            //base.FormBorderStyle = FormBorderStyle.FixedSingle;
            base.MaximizeBox = false;
            base.MinimizeBox = false;
            base.Name = "FormCheckDeleted";
            base.ShowInTaskbar = false;
            this.Text = "Thông báo";
            ((ISupportInitialize) this.grdBrowser).EndInit();
            base.ResumeLayout(false);
        }

        protected override bool ProcessCmdKey(ref Message msg, Keys keyData)
        {
            if (keyData == Keys.Escape)
            {
                base.Close();
            }
            return base.ProcessCmdKey(ref msg, keyData);
        }

        public DataTable LocalTable
        {
            set
            {
                this.oLocalTable = value;
                this.grdBrowser.DataSource = new BindingSource(this.oLocalTable, this.oLocalTable.TableName);
                this.grdBrowser.Columns[0].DataPropertyName = "Ten_File";
            }
        }
    }
}

